﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Netium.Compiler.BackEnd.Interpreter.RuntimeStack
{
    interface IStack
    {
        EventHandler<StackEventArgs> StackPushed;
        EventHandler<StackEventArgs> StackPoped;

        void Push(IStackFrame stackFrame);
        IStackFrame PushNew();
        IStackFrame Pop();
        IStackFrame Peek();
        int Count { get; }
        IStackFrame this[int index] { get; }
        IList<IStackFrame> Frames { get; }
    }

    interface IStackFrame
    {
        int Count { get; }
        IMemorySlot this[string name] { get; }
        IMemorySlot AllocateSlot(string name);
    }

    interface IMemorySlot
    {
        string Name { get; }
        ISymbol Symbol { get; set; }
        object Value { get; set; }
    }
}
